package com.utn.ab.demo.mapper;

import com.utn.ab.demo.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @创建人 liuchunlin
 * @创建时间 15:31
 * @描述
 */
@Mapper
public interface DemoUserMapper {

    @Select("select count(1) from user where sex = #{sex}")
    int testCountBySex(@Param("sex") int sex);

    @Delete("delete from user where name = #{name} and sex = #{sex}")
    void testDeleteBySex(@Param("name") String name, @Param("sex") int sex);

    @Select("select * from user where name = #{name} and sex = #{sex}")
    List<User> testSelect(@Param("name") String name, @Param("sex") int sex);

}
